package com.sjp.myspring.web.servlet;

import lombok.Data;

import java.lang.reflect.Method;
import java.util.regex.Pattern;

@Data
public class JPHandlerMapping {
    private String url;
    private Object controller;
    private Method method;
    private Pattern pattern;//url的正则表达式

    public JPHandlerMapping(Pattern pattern, Object controller, Method method) {
        this.pattern = pattern;
        this.controller = controller;
        this.method = method;
    }

    public JPHandlerMapping(String url, Object controller, Method method) {
        this(Pattern.compile(url), controller, method);
    }
}
